import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex)
const actions={

}
const mutations={

}
const getters={
    addTodo(state, todoObj){
       return state.todos.unshift(todoObj)
    }
}
const state={
    todos: [
        {id: "001", name: '爬山', done: true},
        {id: "002", name: '游泳', done: false},
        {id: "003", name: '跑步', done: true},

    ]
}
const store=new vuex.Store({
    actions,
    mutations,
    state,
    getters
})
export default store